package net.xin.aop;

import org.aspectj.lang.JoinPoint;
import org.springframework.stereotype.Component;

//@Aspect	/*声明是面向切面*/
@Component(value="log")	/*初始化对象*/
public class Log {
//3.@Pointcut("execution(* net.xin.servlet.imple.*.*(..))")
//	public void mypoint() {}
	
	/*用一些通配符来定义在哪些类和方法上增加aop功能*/
//1.@Before("execution(public void net.xin.servlet.imple.UserServletImple.add(net.xin.model.User))")
//2.@Before("execution(* net.xin.servlet.imple.*.*(..))")
//3.@Before("mypoint()")
	public void mybefore(JoinPoint jp) {
		System.out.println(jp.getSignature());
		System.out.println("方法执行开始.......");
	}
	
	
//1.@AfterReturning("execution(public void net.xin.servlet.imple.UserServletImple.add(net.xin.model.User))")
//2.@AfterReturning("execution(* net.xin.servlet.imple.*.*(..))")
//3.@AfterReturning("mypoint()")
	public void myedd(JoinPoint jp) {
		System.out.println("方法执行结束...");
	}
}
